package com.wtf.dsp.admin.model.dto;

import com.wtf.dsp.admin.enums.BizType;
import com.wtf.dsp.admin.enums.CloneType;
import com.wtf.dsp.admin.enums.DataCloneScope;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.util.List;

@Data
@ToString
@ApiModel("数据源克隆请求类")
public class DsCloneDTO {
    @ApiModelProperty(value = "克隆类型")
    @NotNull(message = "请输入克隆类型")
    private CloneType cloneType;

    @ApiModelProperty(value = "克隆数据范围")
    @NotNull(message = "请输入克隆数据范围")
    private DataCloneScope dataCloneScope;

    @ApiModelProperty(value = "克隆业务类型")
    @NotNull(message = "请输入克隆业务")
    private BizType bizType;

    @ApiModelProperty(value = "克隆目标命名空间")
    @Length(min = 0,max = 20,message = "请输入不超过20个字符")
    @Pattern(regexp = "^[-a-zA-Z0-9]+$",message = "请输入英文、数字、-的字符的克隆目标命名空间")
    @NotBlank(message = "请输入克隆目标命名空间")
    private String targetNs;

    @ApiModelProperty(value = "克隆源命名空间")
    @Length(min = 0,max = 20,message = "请输入不超过20个字符")
    @Pattern(regexp = "^[-a-zA-Z0-9]+$",message = "请输入英文、数字、-的字符的克隆源命名空间")
    @NotBlank(message = "请输入克隆源命名空间")
    private String sourceNs;

    @ApiModelProperty(value = "克隆源信息")
    @NotEmpty(message = "请输入克隆源信息")
    private List<SourceInfoDTO> sourceInfos;
}
